package com.ljf.weather.controller;

import com.ljf.weather.domain.WeatherResponse;
import com.ljf.weather.service.WeatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class WeatherController {

    @Autowired
    WeatherService weatherService;

    @GetMapping("/weather")
    public @ResponseBody WeatherResponse getWeather(String cityId){
        System.out.println("into together");
        WeatherResponse wr = weatherService.getWeather(cityId);
        return wr;
    }

}
